web3.js@0.2x.x web3.sha3
web3.sha3(string [, options])
パラメータ
1. String
2. Object
オプショナル
#todo Set encoding to hex if the string to hash is encoded in hex. A leading 0x will be automatically ignored. 戻り値
String
サンプルコード
code:example.js
var hash = web3.sha3("Some string to be hashed");
console.log(hash); // "0xed973b234cf2238052c9ac87072c71bcf33abc1bbd721018e0cca448ef79b379"
var hashOfHash = web3.sha3(hash, {encoding: 'hex'});
console.log(hashOfHash); // "0x85dd39c91a64167ba20732b228251e67caed1462d4bcf036af88dc6856d0fdcc"
使用例を書く
参考